1
'*************************** Module Header ******************************'
2 ' Module Name: WebBrowserTabPage.vb
3 ' Project: VBTabbedWebBrowser
4 ' Copyright (c) Microsoft Corporation.
6 ' This class inherits the the System.Windows.Forms.TabPage class and contains
7 ' a WebBrowserEx property. An instance of this class could be add to a tab control
10 ' It exposes the NewWindow3 event of WebBrowserEx, and handle the DocumentTitleChanged
13 ' This source is subject to the Microsoft Public License.
14 ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
15 ' All other rights reserved.
17 ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
18 ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
19 ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
20 '*************************************************************************'
22 Imports System
.Security
.Permissions
24 Public Class WebBrowserTabPage
26 Private _webBrowser
As WebBrowserEx
27 Public Property WebBrowser() As WebBrowserEx
31 Private Set(ByVal value
As WebBrowserEx
)
36 ' Expose the NewWindow3 event of WebBrowserEx.
37 Public Custom
Event NewWindow
As EventHandler(Of WebBrowserNewWindowEventArgs
)
38 AddHandler(ByVal value
As EventHandler(Of WebBrowserNewWindowEventArgs
))
39 AddHandler WebBrowser
.NewWindow3
, value
41 RemoveHandler(ByVal value
As EventHandler(Of WebBrowserNewWindowEventArgs
))
42 RemoveHandler WebBrowser.NewWindow3, value
49 ''' Initialize the WebBrowserEx instance.
51 <PermissionSetAttribute(SecurityAction
.LinkDemand
, Name
:="FullTrust")> _
54 WebBrowser
= New WebBrowserEx()
55 WebBrowser
.Dock
= DockStyle
.Fill
56 AddHandler WebBrowser
.DocumentTitleChanged
, AddressOf WebBrowser_DocumentTitleChanged
58 Me.Controls
.Add(WebBrowser
)
62 ''' Change the title of the tab page.
64 Private Sub WebBrowser_DocumentTitleChanged(ByVal sender
As Object, ByVal e
As EventArgs
)
65 Me.Text
= WebBrowser
.DocumentTitle